package com.fjec.common.util;

public class BusinessUtil {

    /**
     * busiType转换为秒杀活动允许角色
     *
     * @param busiType
     * @return
     */
    public static Integer busiType2Bin(Integer busiType) {
        switch (busiType) {
            case 2: // 果农
                return 1;
            case 3: // 分拣厂
                return 2;
            case 4: // 农资厂
                return 4;
            case 5: // 包装厂
                return 8;
            case 6: // 采购商
                return 16;
            case 1: // 普通用户
            default:
                return 0;
        }
    }

    /**
     * busiType转换为对应文字
     *
     * @param busiType
     * @return
     */
    public static String busiType2Str(Integer busiType) {
        String result = "";
        switch (busiType) {
            case 1:
                result = "普通用户";
                break;
            case 2:
                result = "种植/养殖户";
                break;
            case 3:
                result = "分拣厂/合作社";
                break;
            case 4:
                result = "物流/农资厂家";
                break;
            case 5:
                result = "包装物厂";
                break;
            case 6:
                result = "超市采购商";
                break;
        }
        return result;
    }

}
